<template>
  <yd-layout>
    <yd-navbar slot="navbar" title="选择项目" />
    <yd-cell-group>
      <yd-cell-item v-for="(item, i) in items" :key="i" arrow>
          <span slot="icon">
            <img :src="item.imgurl" alt="">
          </span>
          <span slot="left">{{item.tname}}</span>
      </yd-cell-item>
    </yd-cell-group>
  </yd-layout>
</template>

<script>
import viewMixin from "../../../mixins/page";
export default {
  mixins: [viewMixin],
  data() {
    return {
      items: [],
    };
  },
  computed: {
     sid() {
      return this.$store.state.reservation.formData.sid;
    },
  },
  methods: {
    onPageView() {
      this.loadData();
    },
    async loadData() {
      let res = await this.$api
        .getStoreItems({ sid: this.sid })
        .catch(err => {});

      if (res) {
        this.items = res;
      }
    },
  },
};
</script>

<style>

</style>
